package saei.persistencia.DAO;

import java.util.List;

import org.hibernate.Query;

import saei.bean.Representacion;

@SuppressWarnings("unchecked")
public class RepresentacionDAO extends EntidadPersistenteDAO{

	public static Representacion buscar(String codigoRepresentacion) {
		List<Representacion> lista = null;
		
		String fromQuery = "from Representacion where codigo = :codigo";
		Query query = getSession().createQuery(fromQuery);
		query.setString("codigo", codigoRepresentacion);
		lista = query.list();
		
		return (Representacion) (lista != null && lista.size() > 0 ? lista.get(0) : null);	
	}
	
}
